//=============================================================================
// SWDA_ChangeMenuBg.js
//=============================================================================

/*:
 * @plugindesc 枫之舞界面 - 变更菜单背景
 * @author 老饕（参考AltMenuScreen3：Sasuke KANNAZUKI, Yoji Ojima）
 * 
 * @default 
 * @param bgBitmapMenu
 * @desc background bitmap file at menu scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapItem
 * @desc background bitmap file at item scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapSkill
 * @desc background bitmap file at skill scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapEquip
 * @desc background bitmap file at equip scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapStatus
 * @desc background bitmap file at status scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapOptions
 * @desc background bitmap file at option scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapQuest
 * @desc background bitmap file at quest scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapFile
 * @desc background bitmap file at save/load scene. put at img/pictures.
 * @default 
 * 
 * @param bgBitmapGameEnd
 * @desc background bitmap file at gameEnd scene. put at img/pictures.
 * @default 
 * 
 * @param menuOpacity
 * @desc changes opacity of main menu
 * @default 0
 * 
 * @param itemOpacity
 * @desc changes opacity of item menu
 * @default 0
 * 
 * @param skillOpacity
 * @desc changes opacity of skill menu
 * @default 0
 * 
 * @param equipOpacity
 * @desc changes opacity of equip menu
 * @default 0
 * 
 * @param statusOpacity
 * @desc changes opacity of status menu
 * @default 0
 * 
 * 
 
 * @help 本插件不提供插件指令。
 *  背景图片放在img/system中
 *
 */

    // set parameters
    var parameters = PluginManager.parameters('SWDA_ChangeMenuBg');
	
    var bgBitmapMenu = parameters['bgBitmapMenu'] || '';
    var bgBitmapItem = parameters['bgBitmapItem'] || '';
    var bgBitmapSkill = parameters['bgBitmapSkill'] || '';
    var bgBitmapEquip = parameters['bgBitmapEquip'] || '';
    var bgBitmapStatus = parameters['bgBitmapStatus'] || '';
    var bgBitmapOptions = parameters['bgBitmapOptions'] || '';
	var bgBitmapQuest = parameters['bgBitmapQuest'] || '';
    var bgBitmapFile = parameters['bgBitmapFile'] || '';
    var bgBitmapGameEnd = parameters['bgBitmapGameEnd'] || '';

    var menuOpacity = Number(parameters['menuOpacity'] || 0);
	var itemOpacity = Number(parameters['itemOpacity'] || 0);
	var skillOpacity = Number(parameters['skillOpacity'] || 0);
	var equipOpacity = Number(parameters['equipOpacity'] || 0);
	var statusOpacity = Number(parameters['statusOpacity'] || 0);

   //
   // make transparent windows for each scenes in menu.
   //
    var _Scene_Menu_create = Scene_Menu.prototype.create;
    Scene_Menu.prototype.create = function() {
        _Scene_Menu_create.call(this);
        // make transparent for all windows at menu scene.
        this._statusWindow.opacity = menuOpacity;
        this._goldWindow.opacity = menuOpacity;
        this._commandWindow.opacity = menuOpacity;

    };

    var _Scene_Item_create = Scene_Item.prototype.create;
    Scene_Item.prototype.create = function() {
        _Scene_Item_create.call(this);
        this._helpWindow.opacity = itemOpacity;
        this._categoryWindow.opacity = itemOpacity;
        this._itemWindow.opacity = itemOpacity;
        this._actorWindow.opacity = itemOpacity;
        //this._infoWindow.opacity = itemOpacity;
        //this._statusWindow.opacity = itemOpacity;
        //this._itemActionWindow.opacity = itemOpacity;
      
		// list for items that can be used to attach to equipment
        //this._augmentListWindow.opacity = itemOpacity;

    };

    var _Scene_Skill_create = Scene_Skill.prototype.create;
    Scene_Skill.prototype.create = function() {
        _Scene_Skill_create.call(this);
        this._helpWindow.opacity = skillOpacity;
        this._skillTypeWindow.opacity = skillOpacity;
        //this._statusWindow.opacity = skillOpacity;
        this._itemWindow.opacity = skillOpacity;
        this._actorWindow.opacity = skillOpacity;
    };

    var _Scene_Equip_create = Scene_Equip.prototype.create;
    Scene_Equip.prototype.create = function() {
        _Scene_Equip_create.call(this);
        this._helpWindow.opacity = equipOpacity;
        this._statusWindow.opacity = equipOpacity;
        this._commandWindow.opacity = equipOpacity;
        this._slotWindow.opacity = equipOpacity;
        this._itemWindow.opacity = equipOpacity;
        this._compareWindow.opacity = equipOpacity;
    };

    var _Scene_Status_create = Scene_Status.prototype.create;
    Scene_Status.prototype.create = function() {
        _Scene_Status_create.call(this);
        this._statusWindow.opacity = statusOpacity;
    };
	

    //
    // load bitmap that set in plugin parameter
    //
    var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;
    Scene_Menu.prototype.createBackground = function(){
		_Scene_Menu_createBackground.call(this);
        if(bgBitmapMenu){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapMenu);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_Item_createBackground = Scene_Item.prototype.createBackground;
    Scene_Item.prototype.createBackground = function(){
		_Scene_Item_createBackground.call(this);
        if(bgBitmapItem){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapItem);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_Skill_createBackground = Scene_Skill.prototype.createBackground;
    Scene_Skill.prototype.createBackground = function(){
		_Scene_Skill_createBackground.call(this);
        if(bgBitmapSkill){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapSkill);
            this.addChild(this._backgroundSprite);
			
            return;
        }
    };

    var _Scene_Equip_createBackground = Scene_Equip.prototype.createBackground;
    Scene_Equip.prototype.createBackground = function(){
		_Scene_Equip_createBackground.call(this);
        if(bgBitmapEquip){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapEquip);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_Status_createBackground =
     Scene_Status.prototype.createBackground;
    Scene_Status.prototype.createBackground = function(){
		_Scene_Status_createBackground.call(this);
        if(bgBitmapStatus){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapStatus);
            this.addChild(this._backgroundSprite);
            return;
        }        
    };

    var _Scene_Options_createBackground =
     Scene_Options.prototype.createBackground;
    Scene_Options.prototype.createBackground = function(){
		_Scene_Options_createBackground.call(this);
        if(bgBitmapOptions){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapOptions);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_Quest_createBackground =
     Scene_Quest.prototype.createBackground;
    Scene_Quest.prototype.createBackground = function(){
		_Scene_Quest_createBackground.call(this);
        if(bgBitmapQuest){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapQuest);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_File_createBackground = Scene_File.prototype.createBackground;
    Scene_File.prototype.createBackground = function(){
		_Scene_File_createBackground.call(this);
        if(bgBitmapFile){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapFile);
            this.addChild(this._backgroundSprite);
            return;
        }
    };

    var _Scene_GameEnd_createBackground =
     Scene_GameEnd.prototype.createBackground;
    Scene_GameEnd.prototype.createBackground = function(){
		_Scene_GameEnd_createBackground.call(this);
        if(bgBitmapGameEnd){
            this._backgroundSprite = new Sprite();
            this._backgroundSprite.bitmap =
             ImageManager.loadBitmap('img/system/UI/', bgBitmapGameEnd);
            this.addChild(this._backgroundSprite);
            return;
        }
    };